import http from '@/utils/request'

// 查询部门列表
export function listDepartment (query) {
  return http({
    url: '/backstage/authority/department',
    method: 'get',
    params: query
  })
}

// 查询部门详细
export function getDepartment (id) {
  return http({
    url: '/backstage/authority/department/' + id,
    method: 'get'
  })
}

// 新增部门
export function addDepartment (data) {
  return http({
    url: '/backstage/authority/department',
    method: 'post',
    data: data
  })
}

// 修改部门
export function updateDepartment (data) {
  return http({
    url: '/backstage/authority/department',
    method: 'put',
    data: data
  })
}

// 删除部门
export function delDepartment (ids) {
  return http({
    url: '/backstage/authority/department',
    method: 'delete',
    params:{ids}
  })
}
// 查询部门树形列表
export function listTreeDepartment (query) {
  return http({
    url: '/backstage/authority/department/tree',
    method: 'get',
    params: query
  })
}